package system

import (
	"MoSkeleton/framework/core/consts"
	"MoSkeleton/framework/core/dto/response"
	"MoSkeleton/services"
	"github.com/gin-gonic/gin"
)

type SystemAuthCtrl struct {
}

// @Summary 退出登录
// @Tags 系统管理
// @Summary 退出登录
// @Security ApiKeyAuth
// @Success 200 {object} response.Response "{"code": 200, "data": null, "msg": "退出成功"}"
// @Router /system/logout [post]
func (a *SystemAuthCtrl) Logout(c *gin.Context) {
	if err := services.ServiceGroupInst.SystemGroupInst.SysAuthServiceInst.Logout(c); err != nil {
		response.FailMsgAsI18n(c, consts.ServerOccurredErrorCode, consts.TKey_CommLogoutFailMsg)
	} else {
		response.SuccessAsI18n(c, consts.TKey_CommonLogoutSuccessMsg, nil)
	}
}
